<template>
  <div>
    <span>用户名 </span><input type="text" name="username" /><br />
    <span style="margin-right: 15px">密码 </span
    ><input type="text" name="password" />

    <div style="margin-top: 20px">
      <button style="margin-right: 20px">登录</button>
      <button @click="changeBtn">注册</button>
      <!-- 简写 -->
      <!--      <button @click="$router.push('/register')">注册</button> -->
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  props: {},
  data() {
    return {}
  },
  computed: {},
  watch: {},
  created() {},
  methods: {
    changeBtn() {
      this.$router.push({
        //path也可以用name：不受影响，所以最好是直接写上name：'配置的name'
        /*     path: '/register',
        query: {
          username: '小明',
        }, */

        //编程思导航用params传参数一定要用name：'配置的name'
        name: 'Register',
        params: {
          username: '小熊',
        },
      })
      //this.$router.push('/register/小兔')
    },
  },
}
</script>

<style scoped></style>
